package com.lin.missyou.vo;

import com.lin.missyou.model.Activity;
import com.lin.missyou.model.Coupon;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 相同属性直接继承
 * @author gcq
 * @Create 2021-11-03
 */
@Getter
@Setter
public class ActivityCouponVo extends ActivityPureVo{

    private List<CouponPureVo> coupons;

    public ActivityCouponVo(Activity activity) {
        super(activity);
        coupons = activity.getCouponList()
                .stream().map(CouponPureVo::new)
                .collect(Collectors.toList());
    }
}